{include file="public/layout" /}
<body>
   <div class="layui-fluid">
      <div class="layui-card">
        <div class="layui-card-body">
          <div class="layui-form layui-border-box layui-table-view house-table" lay-id="admin-arctype" >
            <div class="layui-table-box">
              <div class="layui-table-body " >
                <table cellspacing="0" cellpadding="0" border="0" class="layui-table layui-form" style="width: 100%" lay-skin="line">
                  <thead >
                    <tr>
                      <th class="w120"> 
                        <div class="layui-table-cell w120"><span>模板名称</span></div>
                      </th>
                      <th> 
                        <div class="layui-table-cell wauto"><span>邮件标题</span></div>
                      </th>
                      <th class="w80 tc"> 
                        <div class="layui-table-cell w80 tc"><span>启用</span></div>
                      </th>
                      <th class="w110 tc"> 
                        <div class="layui-table-cell w110 tc"><span>更新时间</span></div>
                      </th>
                    </tr>
                 </thead>
                 <tbody>
                  {empty name="list"}
                    <tr>
                      <td colspan="4" class="no-data tc">
                         没有符合条件的数据
                      </td>
                    </tr>
                  {else/}
                    {foreach name="list" item="vo" key="k" }
                     <tr>
                        <td>
                          <div class="layui-table-cell w120"> 
                            {$vo.tpl_name}
                          </div>
                        </td>
                        <td>
                          <div class="layui-table-cell wauto">
                            <input type="text" name="tpl_title" lay-verify="required" value="{$vo.tpl_title}" onchange="changeTableVal('smtp_tpl','tpl_id','{$vo.tpl_id}','tpl_title',this);" class="layui-input">
                          </div>
                        </td>
                        <td>
                           <div class="layui-table-cell w80 tc">
                              <input type="checkbox" lay-skin="switch" lay-filter="is_open" data-tpl_id="{$vo.tpl_id}" {eq name="$vo['is_open']" value='1'}value="off" checked{else /}value="on"{/eq} lay-text="是|否">
                           </div>
                        </td>
                        <td>
                          <div class="layui-table-cell w110 tc"> 
                            {$vo.update_time|date='Y-m-d',###} 
                          </div>
                        </td>
                      </tr>
                    {/foreach}
                  {/empty}
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  <script>
  layui.config({
    base: '__SKIN__/' //静态资源所在路径
    ,version: '{$version}'
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;

    form.on('switch(is_open)', function(data){
        changeTableVal('smtp_tpl','tpl_id',$(this).data('tpl_id'),'is_open',this);
        return false;
    });

  });

  </script>
{include file="public/footer" /}